extension IterableExtensions<E> on Iterable<E> {
  E? firstOrNull(bool test(E element)) {
    final all = where(test);
    return all.isNotEmpty ? all.first : null;
  }
}
